#ifndef HASH_TABLE
#define HASH_TABLE

#include "hash_table.h"

#define I8 0
#define I16 1
#define I32 2
#define I64 3
#define F32 4
#define F64 5
#define CHAR 6
#define STRING 7
#define OTHERS 8

#define VM_FREE(n) free(n); n = NULL;

typedef union vm_result {
    char i8;
    short i16;
    int i32;
    long long i64;
    float f32;
    double f64;
    char ch;
    char* str;
    void* others;
} vm_result;

typedef union vm_array_result {
    char* i8;
    short* i16;
    int* i32;
    long long* i64;
    float* f32;
    double* f64;
    char* ch;
    char** str;
    void** others;
} vm_array_result;

typedef struct vm_var {
    int type;
    vm_result value;
    int is_array;
    int array_size;
    vm_array_result array_data;
} vm_var;

typedef struct vm_env {
    vm_hash_table* variables;
    int x_type;
    vm_result x;
} vm_env;

#endif